/*
	 determine the ranges of the various floating-point types by computing
	 位运算： &与 |或 ~非 ^异或 <<左移 >>右移 
*/

int main(){
	int u_char_max, u_char_min = 0;
	int char_max, char_min;
	int int_max, int_min; 
	u_char_max = (unsigned char)~0;
	char_max = (unsigned char)~0 >> 1;
	char_min = (char)~0<<7;//负数在进入计算机后按补码存储，且数值大小按补码的二进制字面值计算
 	int_max = (unsigned int)~0 >> 1;
 	int_min = (int)~0 << 31;
	
	
	printf("u_char_max = %d\n", u_char_max);	
	printf("u_char_min = %d\n", u_char_max);	
	printf("char_max = %d\n", char_max);
	printf("char_min = %d\n", char_min);
	printf("int_max = %d\n", int_max);
	printf("int_min = %d\n", int_min);
	
	
	return 0;
}



